﻿using BeetleX.XRPC.Packets;
using System.Buffers;

#nullable disable
namespace BeetleX.XRPC
{
    public class Options
    {
        public bool LogToConsole { get; set; } = true;

        public bool LogToFile { get; set; } = true;

        public int MessageMaxLength { get; set; } = 1048576;

        public int ParameterMaxLength { get; set; } = 1048576;

        public IParameterFormater ParameterFormater { get; set; } = new JsonPacket();

        public byte[] PopBuffer(int length) => ArrayPool<byte>.Shared.Rent(length);

        public void PushBuffer(byte[] buffer, int length) => ArrayPool<byte>.Shared.Return(buffer);
    }
}
